package org.li.dwr;
import org.springframework.stereotype.Service;  
import java.util.Date;
import java.util.ArrayList;
import java.util.List;

import org.directwebremoting.annotations.RemoteMethod;
import org.directwebremoting.annotations.RemoteProxy;
@Service("hellohello")
@RemoteProxy(name ="hellohello")
public class Hello {
	public String getHelloWorld() {
		return "现在的时间为：" + new Date();
	}

	@RemoteMethod
	public String alertStr() {
		return "DWR框架：无参数";
	}

	@RemoteMethod
	public String alertJSStr(String jsvalue) {
		return "DWR框架:" + jsvalue;
	}

	@RemoteMethod
	public ArrayList returnAl() {
		ArrayList al = new ArrayList();
		al.set(1, "a");
		al.set(2, "b");
		al.set(3, "c");
		al.set(4, "d");
		return al;
	}

	@RemoteMethod
	public List getList() {
		List list = new ArrayList();
		for (int i = 0; i < 5; i++) {
			InputRecord ir = new InputRecord();
			ir.setId(1);
			ir.setName("依韵");
			ir.setSex("男");
			ir.setAddress("北京市");
			list.add(ir);
		}
		return list;
	}

	@RemoteMethod
	public InputRecord getObj() {
		InputRecord ir = new InputRecord();
		ir.setId(2);
		ir.setName("白色黄昏");
		ir.setSex("女");
		ir.setAddress("河南");
		return ir;
	}

}
